package org.oos.model;

import java.util.Date;

import org.oos.OOS4Java;
import org.oos.atom.elements.Author;
import org.oos.atom.elements.Text;
import org.oos.atom.entries.CheckinEntry;

/**
 * 
 * 
 * @author pablo.gonzalez@11870.com
 *
 */
public class Checkin extends AbstractEntityImpl {

	private static final long serialVersionUID = 264860631779577824L;
	private CheckinEntry entry;
	private boolean topChecker = false;
	
	public Checkin(OOS4Java oos4Java, CheckinEntry entry) {
		super(oos4Java);
		this.entry = entry;
	}
	
	public Author getAuthor() {
		if(entry != null) {
			return entry.getAuthor();
		} else {
			return null;
		}
	}
	
	public Date getDate() {
		if(entry != null) {
			return entry.getUpdated();
		} else {
			return null;
		}
	}
	
	public String getSiteSlug() {
		return entry.getSiteSlug();
	}
	
	public String getTitle() {
		return entry.getTitle().getValue();
	}
	
	public boolean isTopChecker() {
		return topChecker;
	}
	
	public void setTopChecker(boolean topChecker) {
		this.topChecker = topChecker;
	}

	public int getCount() {
		return entry.getCount();
	}
	
	public Text getContent() {
		return entry.getContent();
	}
	
}
